import FetchRequest from '@tools/request'
import  qs from 'qs';
import {
    UploadPicParamType,
    ParamsType
} from './type'

const { put, post } = new FetchRequest()
// 登录
export const login = (params:ParamsType) => post(`api/admin/systemLogin/login`, params)
// 退出
export const loginOut = (params:ParamsType) => post(`api/admin/systemLogin/loginOut`, params)

// 单张图片上传
export const uploadPic = (params:UploadPicParamType, fromData:FormData) => put(`api/admin/upload/uploadPic?${qs.stringify(params)}`, fromData)

// 系统字典项
export const getDic = () => post(`api/admin/sysDictionary/getDic`)

// 获取项目阶段菜单、列表
export const getProjectPhaseMenu = (params:ParamsType) => post(`api/admin/projectPhase/getProjectPhaseMenu`, params)
export const getPhaseAllList = () => post(`api/admin/projectPhase/getAllList`)

// 项目管理列表
export const getProjectAllList = () => post(`api/admin/project/getAllList`)

// 项目期数阶段时间管理列表、编辑、保存
export const getProjectIssuePhaseList = (params:ParamsType) => post(`api/admin/projectIssuePhase/getPageList`, params)
export const saveOrUpdateProjectIssuePhase = (params:ParamsType) => post(`api/admin/projectIssuePhase/saveOrUpdate`, params)

// 小组管理列表、编辑、保存、删除
export const getTeamGroupList = (params:ParamsType) => post(`api/admin/team/getPageList`, params)
export const getTeamGroupAllList = () => post(`api/admin/team/getAllList`)
export const editTeamGroup = (params:ParamsType) => post(`api/admin/team/edit`, params)
export const saveTeamGroup = (params:ParamsType) => post(`api/admin/team/save`, params)
export const delTeamGroup = (params:ParamsType) => post(`api/admin/team/delete`, params)

// 组员管理列表、编辑、保存、删除
export const getMemberList = (params:ParamsType) => post(`api/admin/member/getPageList`, params)
export const editMember = (params:ParamsType) => post(`api/admin/member/edit`, params)
export const saveMember = (params:ParamsType) => post(`api/admin/member/save`, params)
export const delMember = (params:ParamsType) => post(`api/admin/member/delete`, params)

// 知识讲解列表
export const getPhaseCoursewareList = (params:ParamsType) => post(`api/admin/projectPhaseCourseware/getPhaseCoursewareList`, params)
// 场外咨询预约管理
export const getConsultAppointment = (params:ParamsType) => post(`api/admin/consultAppointment/getPageList`, params)
export const getFinance = (params:ParamsType) => post(`api/admin/finance/getPageList`, params)

// 小组探测计划书保存
export const getTeamDetectPlanList= (params:ParamsType) => post(`api/admin/teamDetectPlan/getPageList`, params)
export const saveTeamDetectPlan = (params:ParamsType) => post(`api/admin/teamDetectPlan/edit`, params)

// 小组探测总结报告
export const getTeamDetectSummary= (params:ParamsType) => post(`api/admin/teamDetectSummary/getPageList`, params)
export const saveTeamDetectSummary = (params:ParamsType) => post(`api/admin/teamDetectSummary/edit`, params)

// 项目期数
export const getProjectIssueAllList = () => post(`api/admin/projectIssue/getAllList`)

// 组员证书颁发管理列表、编辑、保存、删除
export const getTeamCertificateList = (params:ParamsType) => post(`api/admin/teamCertificate/getPageList`, params)
export const saveTeamCertificate = (params:ParamsType) => post(`api/admin/teamCertificate/saveOrUpdate`, params)

// 商业计划书管理列表、编辑
export const getTeamBusinessPlanList = (params:ParamsType) => post(`api/admin/teamBusinessPlan/getPageList`, params)
export const saveTeamBusinessPlan = (params:ParamsType) => post(`api/admin/teamBusinessPlan/edit`, params)

// 拍卖结果管理列表、编辑
export const getTeamAuctionList = (params:ParamsType) => post(`api/admin/teamAuction/getPageList`, params)
export const saveTeamAuction = (params:ParamsType) => post(`api/admin/teamAuction/edit`, params)

// 商业运营
export const getTeamProfitList = (params:ParamsType) => post(`api/admin/teamProfit/getPageList`, params)
export const saveTeamProfit = (params:ParamsType) => post(`api/admin/teamProfit/edit`, params)

// 发射总结报告管理列表、编辑
export const getTeamLaunchSummaryList = (params:ParamsType) => post(`api/admin/teamLaunchSummary/getPageList`, params)
export const saveTeamLaunchSummary = (params:ParamsType) => post(`api/admin/teamLaunchSummary/edit`, params)

// 探测设计报告
export const getTeamDetectDesignList = (params:ParamsType) => post(`api/admin/teamDetectDesign/getPageList`, params)
export const saveTeamDetectDesign = (params:ParamsType) => post(`api/admin/teamDetectDesign/edit`, params)

// 小组排行数据查询
export const getTeamProjectTopList = (params:ParamsType) => post(`api/admin/teamProject/getTeamProjectTopList`, params)

// 小组财务报表管理
export const getTeamFinance = (params:ParamsType) => post(`api/admin/teamFinance/getTeamFinance`, params)

// admin/teamDetectEquipment/edit
// 探测设备管理
export const getSelectDetectEquipmentList = (params:ParamsType) => post(`api/admin/teamDetectEquipment/getSelectDetectEquipmentList`, params)
export const TeamDetectEquipmentedit = (params:ParamsType) => post(`api/admin/teamDetectEquipment/edit`, params)
// POST /admin/teamDetectEquipment/edit

// TeamTestResultController

// 小组飞行任务报告
export const saveTeamTaskDesign = (params:ParamsType) => post(`api/admin/teamTaskDesign/edit`, params)
// 获取飞行 分类数据
export const getTeamTaskDesignList = (params:ParamsType) => post(`api/admin/teamTaskDesign/getTeamTaskDesignList`, params)
// 探测设备-获取飞行计划设计报表
export const getDetectEquipmentList2 = (params:ParamsType) => post(`api/admin/detectEquipment/getPageList2`, params)

// POST /admin/teamComment/edit
// 探测设备-获取飞行计划设计报表
export const setTeamComment = (params:ParamsType) => post(`api/admin/teamComment/saveOrUpdate`, params)
export const getTeamComment = (params:ParamsType) => post(`api/admin/teamComment/getPageList`, params)
// POST /admin/teamComment/saveOrUpdate